<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">退货地址数据</a>
    <div class="well">
	    <div class="btn-toolbar">
	    	<button class="btn btn-primary ifrm" data-url="/readdres/addset" data-width="650" data-height="450" data-title="添加地址" data-params="" style="position:relative;float:right;padding:3px 6px;margin-right:10px">添加地址</button>
		    <form id="formid" action="/index.php/readdres/index" method="post">
		    	<label style="display: inline;">收货人名称：</label>
		    	<input type="text" value="<?=I('get.receiver')?>" name="receiver" />
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center">序号</th>
		          <th style="text-align:center">收货人</th>
		          <th style="text-align:center">联系电话</th>
		          <th style="text-align:center">退货地址</th>
		          <th style="text-align:center">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($data){foreach($data as $key=>$val){ ?>
				   <?php if($val[1]){?> 
		        <tr> 
		          <td style="text-align:center;"><?=$key?></td>
		          <td style="text-align:center;"><?=$val['0']?></td>
		          <td style="text-align:center;"><?=$val['1']?></td>
		          <td style="text-align:center;" ><?=$val['2']?></td>
		       
		          <td style="text-align:center">
		          	  <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/readdres/addedit" data-width="650" data-height="450" style="padding: 0px 4px;" data-title="修改地址" data-params="id/<?=$key?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
		              <a href="/readdres/delete?id=<?=$key?>" class="delete btn btn-danger" style="padding: 0px 4px;" data-toggle="modal"><i class="icon-remove"></i></a>
		          
		          </td>
		        </tr>
				  <?php }?> 
		        <?php }}else{?>
		        <tr> <td style="text-align:center;" colspan=5>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.delete').click(function(){
		if(!(window.confirm('确认要删除该退货地址吗 ?'))){
			return false;
		}		
		window.location = $(this).attr('href');
	});
})
</script>